package cn.dengta.webapp.user.entity;

import java.util.Date;

import cn.dengta.webapp.base.entity.TimeBasedEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 用户申诉日志
 *
 * @author hsj
 * @since 2024-02-20
 */
@Setter
@Getter
@Accessors(chain = true)
public class UserAppealLog extends TimeBasedEntity {

	/** 用户Id */
	Long userId;
	/** 用户昵称 */
	String nickname;
	/** 申述原因 */
	String reason;
	/** 封号原因 */
	String freezeReason;
	/** 冻结时间 */
	Date freezeTime;
	/** 0: 待审核；1：申诉通过；2：已忽略 */
	Integer status;

	private transient Long channelId;

	public String getStatus_() {
		return getStatus_(this.status);
	}

	public static String getStatus_(Integer status) {
		return switch (status) {
			case 0 -> "待审核";
			case 1 -> "申诉通过";
			case 2 -> "已忽略";
			default -> throw new IllegalStateException("Unexpected value: " + status);
		};
	}

	public static final String USER_ID = "user_id";
	public static final String NICKNAME = "nickname";
	public static final String REASON = "reason";
	public static final String FREEZE_REASON = "freeze_reason";
	public static final String FREEZE_TIME = "freeze_time";
	public static final String STATUS = "status";

}
